def main():
    f = input("введите")
    s1 = []
    for c in f:
        if c == '(':
            s1.append(c)
        if c == ')':
            if len(s1) > 0 and s1[-1] == '(':
                s1.pop()

    for c in f:
        if c == '{':
            s1.append(c)
        if c == '}':
            if len(s1) > 0 and s1[-1] == '{':
                s1.pop()

    for c in f:
        if c == '[':
            s1.append(c)
        if c == ']':
            if len(s1) > 0 and s1[-1] == '[':
                s1.pop()

    if len(s1) == 0:
        print("TRUE")
    else:
        print("FALSE")

if _name_ == "_main_":
    main()
